package com.ihcy.base.enums;

import com.ihcy.base.core.enums.EnumAbility;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum PositioneEnum implements EnumAbility<String> {
    /**
     * 企业职位
     */
    Sales("1", "销售"),
    Purchasing("2", "采购"),
    GeneralManager("0", "总经理");

    private String code;
    private String description;

    public static PositioneEnum getByCode(String code) {
        PositioneEnum[] values = PositioneEnum.values();
        for (PositioneEnum value : values) {
            if (Objects.equals(value.getCode(), code)) {
                return value;
            }
        }
        return null;
    }
}
